import { ProductInfo } from 'src/product-info/entities/product-info.entity';
import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';

@Entity({ name: 'Users' }) // 指定表名
export class Users {
  @PrimaryGeneratedColumn({ name: '_Identify' })
  id: number;

  @Column()
  userid: string;

  @Column()
  name: string;

  @Column({ nullable: true })
  department: string;

  @Column({ nullable: true })
  position: string;

  @Column({ nullable: true })
  mobile: string;

  @Column()
  gender: number;

  @Column({ nullable: true })
  email: string;

  @Column({ nullable: true })
  weixinid: string;

  @Column()
  avatar: string;

  @Column({ nullable: true })
  extattr: string;

  @Column({ nullable: true })
  permit: string;

  @Column({ nullable: true })
  openqqpassword: string;

  @Column({ type: 'bit' })
  admin: boolean;

  @Column({ nullable: true })
  pcpwd: string;

  @Column({ type: 'bit' })
  deleted: boolean;

  @Column({ nullable: true })
  address: string;

  @Column()
  status: string;

  @Column({ type: 'int' })
  useraccountId: number;

  @Column({ nullable: true })
  openid: string;

  @OneToMany(() => ProductInfo, (productinfo) => productinfo.user)
  productinfo: ProductInfo[];
}
